const express = require("express");
const db = require("../db");
const router = express.Router();

// 获取弹幕
router.get("/getContact", (req, res) => {
  db.query("select content from contact", (err, results) => {
    if (err) {
      return res.status(500).send({
        status: 500,
        data: { message: "获取失败", error: err.message }
      });
    }
    res.send({
      status: 200,
      data: {
        message: "获取成功",
        content: results
      }
    });
  });
});

module.exports = router;
